#include<bits/stdc++.h>
#define int long long 
using namespace std;
namespace IO{
    char buff[1<<21],*p1=buff,*p2=buff;
    char getch(){
        return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;
    }
    template<typename T>
    void read(T &x){
        char ch=getch();int fl=1;x=0;
        while(ch>'9'||ch<'0'){if(ch=='-')fl=-1;ch=getch();}
        while(ch<='9'&&ch>='0'){x=x*10+ch-48;ch=getch();}
        x*=fl;
    }
    template<typename T,typename ...Args>
    void read(T &x,Args& ...args){
        read(x);read(args...);
    }
    char obuf[1<<21],*p3=obuf;
    void putch(char ch){
        if(p3-obuf<(1<<21))*p3++=ch;
        else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=ch;
    }
    char ch[100];
    template<typename T>
    void write(T x){
        if(!x)return putch('0');
        if(x<0)putch('-'),x*=-1;
        int top=0;
        while(x)ch[++top]=x%10+48,x/=10;
        while(top)putch(ch[top]),top--;
    }
    template<typename T,typename ...Args>
    void write(T x,Args ...args){
        write(x);write(args...);
    }
    void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
const int N=5e5+5;
int n,k,d,now;
int a[N],b[N];
int w[N],f[N],g[N];
vector<int>Del[N];
int tag[N];
multiset<int,greater<int>>q[N],s;
void Move(int _){
	for(auto x:Del[_]){
		s.erase(s.find((*q[w[x]].begin())-tag[w[x]]));
		q[w[x]].erase(q[w[x]].find(f[x]+g[x]));
		s.insert((*q[w[x]].begin())-tag[w[x]]);
	}
}
signed main(){
	freopen("holiday.in","r",stdin);
	freopen("holiday.out","w",stdout);
	read(n,k,d);
	for(int i=1;i<=n;i++)read(a[i]);
	for(int i=1;i<n;i++)read(b[i]);
	for(int i=1;i<n;i++)Del[i+b[i]+1].push_back(i);
	f[1]=a[1],w[1]=now,g[1]=0;
	q[now].insert(f[1]);
	s.insert(f[1]);
	for(int i=2;i<=n;i++){
		Move(i);
		now=(now+1)%k;
		if(q[now].size()){
			s.erase(s.find((*q[now].begin())-tag[now]));
			tag[now]+=d;
			s.insert((*q[now].begin())-tag[now]);
		}
		f[i]=(*s.begin())+a[i],g[i]=tag[now],w[i]=now;
		if(q[now].size())s.erase(s.find(*q[now].begin()-tag[now]));
		q[now].insert(f[i]+tag[now]);
		s.insert(*q[now].begin()-tag[now]);
	}
	write(f[n]);
	flush();
	return 0;
}
